TARGET := $(TARGET_LIB_ALG_DEPLOY_A)
TARGET_SO := $(TARGET_LIB_ALG_DEPLOY_SO)

SUB_DIRS := algapi 

# 如果.a存在，使用.a库编译，如果.a不存在，直接使用源码编译
ifeq ($(INFERENCE_ENGINE), nnie)
	SUB_DIRS += alghinnie
  ifeq ($(TARGET_NNIE_BASIC_A), $(wildcard $(TARGET_NNIE_BASIC_A)))
	TARGET_DEPEND_A := $(TARGET_NNIE_BASIC_A)
  else
	SUB_DIRS += algbasic_hinnie/src
  endif
else ifeq ($(INFERENCE_ENGINE), mxnet)
	SUB_DIRS += algmxnet
  ifeq ($(TARGET_MX_BASIC_A), $(wildcard $(TARGET_MX_BASIC_A)))
	TARGET_DEPEND_A := $(TARGET_MX_BASIC_A)
  else
	SUB_DIRS += algbasic_mxnet/src
  endif
else ifeq ($(INFERENCE_ENGINE), caffe)
	SUB_DIRS += algcaffe
	SUB_DIRS += algcaffe/caffe_basic/src
  ifeq ($(TARGET_CAFFE_BASIC_A), $(wildcard $(TARGET_CAFFE_BASIC_A)))
	TARGET_DEPEND_A := $(TARGET_CAFFE_BASIC_A)
  else
	SUB_DIRS += algbasic_caffe/src
  endif
endif

# 如果.a存在，使用.a库编译，如果.a不存在，直接使用源码编译
ifeq ($(TARGET_ALG_COMMON_BASIC_A), $(wildcard $(TARGET_ALG_COMMON_BASIC_A)))
	TARGET_DEPEND_A += $(TARGET_ALG_COMMON_BASIC_A)
else
	SUB_DIRS += algcommon/src
endif

ifeq ($(TARGET_COMMON_BASIC_A), $(wildcard $(TARGET_COMMON_BASIC_A)))
	TARGET_DEPEND_A += $(TARGET_COMMON_BASIC_A)
else
	SUB_DIRS += common/src
endif

ifeq ($(OUTPUT_SO),y)
	include $(PROJ_PATH)/target_a_so.mak
else
	include $(PROJ_PATH)/target_a.mak
endif
